<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>常用指令: v-on</title>
</head>
<script src="js/vue.js"></script>
    <script>
        window.onload =function(){
            new Vue({
                el:'#app',
                data:{
                  msg:"",
                  arr:[12,32,12,23]
                },
                methods:{
                    show:function(){
                        console.log('show方法')
                    },
                    add:function(){
                        this.arr.push(22222);
                    }
                }
            })
        }
    </script>
<body>
    <div id="app">
        <button v-on:click="show()">点我</button>
        <button v-on:click="add()">向数组添加一个元素</button>
        <br>
        <ul>
            <li v-for="value in arr">{{value}}</li>
        </ul>
    </div>
</body>
</html>